package com.example.clxy.dao;

import com.example.clxy.entity.Question;
import com.example.clxy.entity.dto.QuestionDto;
import com.example.clxy.entity.dto.QuestionDto2;
import com.example.clxy.result.business.PageResult.QuestionPageResult;
import com.example.clxy.result.business.QuestionResult;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface QuestionMapper {
    int deleteByPrimaryKey(String questionid);

    int deleteQuestionInExperimentbyquestionid(String questionid);

    int deleteQuestionInPlatformbyquestionid(String questionid);

    int insert(Question record);

    int insertSelective(Question record);

    int updateByPrimaryKeySelective(Question record);

    int updateByPrimaryKey(QuestionDto2 record);

    List<QuestionPageResult> getQuestionList(@Param("content")String content,
                                             @Param("begin")int begin,
                                             @Param("end")int end,
                                             @Param("pagesize")int pagesize);

    int ExperimentbindQuestion(@Param("experimentid") String experimentid,
                               @Param("questionid") String questionid);

    int PlatformbindQuestion(@Param("platformid")String platformid,
                             @Param("questionid") String questionid);


    List<QuestionPageResult> getQuestionListbyExperiment(@Param("experimentid")String experimentid,
                                                         @Param("content") String content,
                                                         @Param("begin")int begin,
                                                         @Param("end")int end,
                                                         @Param("pagesize")int pagesize);

    List<QuestionPageResult> getQuestionListbyPlatform(@Param("platformid")String platformid,
                                                       @Param("content") String content,
                                                       @Param("begin")int begin,
                                                       @Param("end")int end,
                                                       @Param("pagesize")int pagesize);

    List<QuestionPageResult> getallQuestionListwithExperiment(@Param("content") String content,
                                                              @Param("begin")int begin,
                                                              @Param("end")int end,
                                                              @Param("pagesize")int pagesize);

    List<QuestionPageResult> getallQuestionListwithPlatform(@Param("content") String content,
                                                            @Param("begin")int begin,
                                                            @Param("end")int end,
                                                            @Param("pagesize")int pagesize);

    QuestionResult getQuestionbyId(String questionid);

    List<String> getQuestionExperimentid(String questionid);

    List<String> getQuestionPlatformid(String questionid);

    int insertQuestionMutiPlatform(QuestionDto questionDto);

    int insertQuestionMutiExperiment(QuestionDto questionDto);

    int deleteQuestionMutiPlatform(String questionid);

    int deleteQuestionMutiExperiment(String questionid);

    List<QuestionPageResult> getQuestionListbyPlatformProportionally(@Param("platformid")String platformid,
                                                                            @Param("content") String content,
                                                                            @Param("begin")int begin,
                                                                            @Param("end")int end,
                                                                            @Param("pagesize")int pagesize);

    List<QuestionPageResult> getQuestionListbyExperimentProportionally (@Param("experimentid")String experimentid,
                                                                               @Param("content") String content,
                                                                               @Param("begin")int begin,
                                                                               @Param("end")int end,
                                                                               @Param("pagesize")int pagesize);

    List<QuestionPageResult> getQuestionListOnlybyExperiment (@Param("experimentid")String experimentid,
                                                                        @Param("content") String content,
                                                                        @Param("begin")int begin,
                                                                        @Param("end")int end,
                                                                        @Param("pagesize")int pagesize);





    int isPassSafetyAssessment (@Param("scheduleid") String scheduleid,
                                @Param("studentid") String studentid,
                                @Param("status") String status);

}
